package com.atguigu.practice;

import java.util.Scanner;

public class TheLeastSubArray {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] a=new int[n];
        for(int i=0;i<n;i++){
            a[i]=scanner.nextInt();
        }
        int res=1;
        for(int i=1;i<n-1;i++){
            if((a[i-1]<=a[i]&&a[i]>=a[i+1])||(a[i-1]>=a[i]&&a[i]<=a[i+1])){
                res++;
                if(i!=n-3){
                    i++;
                }
            }
        }
        System.out.println(res);
    }
}
